<?php

class meeting extends spController{ 

	function __construct(){ 
		parent::__construct(); 
	}

	function index(){ 
		$data = $this->spArgs();
		$meeting_class = spClass('m_article');
		$this->article_id = '';
		if( isset( $data['article_id'] ) ){ 
			$this->article_id = $data['article_id'];
			$single_article_result = $meeting_class->findAll( array('id'=>$data['article_id']) );
			$this->single_article = array(
				'content' => $single_article_result[0]['content'],
				'description' => $single_article_result[0]['description'],
				);
			$cat_id = $single_article_result[0]['cat_id'];
		}else{ 
			$this->single_article = array(
				'content' => '',
				'description' => '',
				);
			$cat_id = 58;
		}

		$info = array(
			"58"=>array("title"=>"第二届智能体与多智能体系统研讨会","date"=>"2015年8月21日","city"=>"山西&nbsp;&nbsp;太原"),
			"69"=>array("title"=>"第三届智能体与多智能体系统研讨会","date"=>"2016年5月20日","city"=>"广西&nbsp;&nbsp;桂林")
			);
		
		$all_articles = $meeting_class->findAll(array('cat_id'=>$cat_id),'weight DESC');
		$all_title = array();
		foreach( $all_articles as $key => $val ){ 
			$all_title[] = array(
				'id' => $val['id'],
				'title' => $val['title'],
				);
		}
		$this->all_title = $all_title;
		$this->info = $info[$cat_id];

		//网站信息
		$setting = spClass("m_setting");	
		$setting_result = $setting->findAll();
	
		$this->cms_title = $setting_result[0]['content'];
		$this->cms_description = $setting_result[1]['content'];
		$this->cms_address = $setting_result[2]['content'];
		$this->cms_keywords = $setting_result[3]['content'];

		$this->cms_phone = $setting_result[4]['content'];
		$this->cms_email = $setting_result[5]['content'];

		$this->cms_record = $setting_result[6]['content'];
        $this->cms_ann = $setting_result[7]['content'];

        $this->cms_is_time_visible = $setting_result[8]['content'];
        
		$this->page_title = $this->cms_title;

        $this->email_server_address = $setting_result[9]['content'];
        $this->email_server_username = $setting_result[10]['content'];
        $this->email_server_password = $setting_result[11]['content'];
        $this->email_recieve_address = $setting_result[12]['content'];

		//var_dump($this->single_article);
		$this->display("tpl/meeting_header.html");
		$this->display("tpl/meeting_detail.html");
		$this->display("tpl/footer.html");
	}

}
